
//- This source code is licensed under the terms of the
//- GNU Affero General Public License found in the LICENSE file in
//- the root directory of this source tree.
//-
//- Copyright (c) 2021-present Kaleidos INC

.ticket-section-label
    span {{ 'COMMON.FIELDS.ASSIGNED'|translate }}

.ticket-user-list-container
    div.loading-container(ng-show="loading")
        img.loading-spinner(
            src="#{v}/svg/spinner-circle.svg",
            alt="{{'COMMON.LOADING' | translate}}"
        )
    .ticket-user-list-content(ng-class="{ 'loading': loading }")
        .ticket-user-list
            .user-list-single(
                ng-if="assignedUser"
                ng-class="{ 'read-only': !isEditable }"
            )
                .user-list-avatar(ng-class="{ 'is-iocaine': isIocaine }")
                    img(
                        tg-avatar="assignedUser"
                        alt="{{assignedUser.full_name_display}}"
                    )
                    .iocaine-symbol(
                        ng-if="isIocaine"
                        title="{{ 'TASK.TITLE_ACTION_IOCAINE' | translate }}"
                    )
                        tg-svg(svg-icon="icon-iocaine")
                .user-list-name
                    span {{assignedUser.full_name_display}}

                tg-svg.remove-user(
                    ng-if="isEditable",
                    svg-icon="icon-close",
                    title="{{'COMMON.ASSIGNED_TO.DELETE_ASSIGNMENT' | translate}}"
                    data-user-id="{{ assignedUser.id }}"
                )

        .ticket-users-actions(ng-if="isEditable")
            a.ticket-users-action(
                ng-click="openAssignedUsers()"
            )
                tg-svg.users-action.icon(svg-icon="icon-add")
                span {{ "COMMON.ASSIGNED_USERS.ADD_ASSIGNED" | translate }}

            a.ticket-users-action(
                ng-if="!isSelfAssigned"
                ng-click="selfAssign()"
            )
                span {{ 'COMMON.ASSIGNED_TO.SELF' | translate }}
